package com.cskaoyan.market.controller.Admin;

import com.cskaoyan.market.service.admin.MarketRegionService;
import com.cskaoyan.market.util.ResponseUtil;
import com.cskaoyan.market.vo.MarketRegionVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import javax.servlet.http.HttpServlet;

import java.io.IOException;
import java.util.List;


@RequestMapping("/admin/region")
@RestController
public class AdminRegionController extends HttpServlet {
    @Autowired
    MarketRegionService marketRegionService;

    @GetMapping("list")
    public Object list()  {
        List<MarketRegionVo> marketRegionVoList;

        marketRegionVoList = marketRegionService.list();
        return ResponseUtil.okList(marketRegionVoList);

    }
}
